<template>
	<div class="box-item" @click="onJump(item.correlationMenuName)">
		<div class="box-item-icon" :style="{background: item.bgColor}">
			<div :class="item.icon"></div>
		</div>
		<div class="box-item-name">
			<span>{{ item.name }}</span>
			<div v-if="item.count > 0" class="box-item-count">({{ item.count }})</div>
		</div>
	</div>
</template>
<script>
    import { firstCharacterToUpperCase } from '../../../../utils/jk/jk-tool';

    export default {
        props: {
            item: {
                type: Object,
                default() {
                    return {};
                }
            }
        },
        data() {
            return {
            };
        },
        methods: {
            onJump(name) {
                this.$toMainRouter({
                    name: firstCharacterToUpperCase(name)
                });
            }
        },
        mounted() {
        }
    };
</script>
<style scoped lang="scss">
$icon_size: 30px;
.box-item {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: solid 1px #eee;
    border-radius: 8px;
    cursor: pointer;
    padding: 0 14px;
    box-sizing: border-box;
    .box-item-icon {
        width: $icon_size;
        height: $icon_size;
        flex-shrink: 0;
        border-radius: 50%;
        font-size: 18px;
        color: #fff;
        margin-right: 4px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .box-item-name {
        width: 100%;
        font-size: 13px;
        color: #515a6e;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
        .box-item-count {
            color: #ff4949;
            font-size: 14px;
            font-weight: 500;
        }
    }
}
.box-item:hover {
    border-color: #5cadff;
    .box-item-name {
        color: #2d8cf0;

    }
}
</style>
